package com.fs.uc.core.permcheck;

import com.fs.uc.core.SubjectType;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;

/**
 * @author 崔超
 * 2021/12/9
 */
@ApplicationScoped
public class PermissionCheckerFactory {
    @Inject
    OrgPermissionChecker orgPermissionChecker;
    @Inject
    PersonPermissionChecker personPermissionChecker;

    public IPermissionChecker getChecker(SubjectType type) {
        if (type == SubjectType.Org) {
            return orgPermissionChecker;
        } else {
            return personPermissionChecker;
        }
    }
}
